cmake_minimum_required(VERSION 3.16)

project(evnetplusexample LANGUAGES CXX)

option(EVNETPLUS_EXAMPLES_ENABLE "Generator example exec files enable" OFF)

include_directories(${evnetplusexample_SOURCE_DIR})

add_subdirectory(evnetplus)

if (EVNETPLUS_EXAMPLES_ENABLE)

add_executable(client_example ${evnetplusexample_SOURCE_DIR}/examples/client-example.cc)
target_link_libraries(client_example evnetplus)

add_executable(server_example ${evnetplusexample_SOURCE_DIR}/examples/server-example.cc)
target_link_libraries(server_example evnetplus)

add_executable(http_server_example ${evnetplusexample_SOURCE_DIR}/examples/http-server-example.cc)
target_link_libraries(http_server_example evnetplus)

add_executable(http_client_example0 ${evnetplusexample_SOURCE_DIR}/examples/http-client-example0.cc)
target_link_libraries(http_client_example0 evnetplus)

add_executable(http_client_example1 ${evnetplusexample_SOURCE_DIR}/examples/http-client-example1.cc)
target_link_libraries(http_client_example1 evnetplus)

add_executable(http_client_example2 ${evnetplusexample_SOURCE_DIR}/examples/http-client-example2.cc)
target_link_libraries(http_client_example2 evnetplus)

add_executable(udp-server-example ${evnetplusexample_SOURCE_DIR}/examples/udp-server-example.cc)
target_link_libraries(udp-server-example evnetplus)

add_executable(timer-example ${evnetplusexample_SOURCE_DIR}/examples/timer-example.cc)
target_link_libraries(timer-example evnetplus)

add_executable(async-udp-client-example ${evnetplusexample_SOURCE_DIR}/examples/async-udp-client-example.cc)
target_link_libraries(async-udp-client-example evnetplus)

add_executable(udp-client-plus-example ${evnetplusexample_SOURCE_DIR}/examples/udp-client-plus-example.cc)
target_link_libraries(udp-client-plus-example evnetplus)

endif(EVNETPLUS_EXAMPLES_ENABLE)
